1. Field of the Invention
The present invention relates to an image processing apparatus which executes compression coding of image information using a generalized block truncation coding (GBTC) method.
2. Description of the Related Art
In recent years the generalized block truncation coding method has been proposed as a method for compression/expansion of document image data. In the GBTC method, document image data are extracted for each block of a predetermined pixel matrix, and the data of each pixel within a block are compression coded as code data quantized to a gradient level smaller than said data within a range of gradient distribution within said block based on mean value information LA determined by dividing the sum of a mean value Q1 of data values below a parameter P1 determined from data within the block and a mean value Q4 of data values above a parameter P2 (where P1&lt;P2 relationship is satisfied), and a gradient range exponent LD expressing the difference in the mean value Q1 and said mean value Q4.
FIGS. 1a through 1c illustrate the flow of a typical GBTC encoding process. In the GBTC method, image data of a document image are extracted in 4.times.4 pixel block units. The image data within the extracted 4.times.4 pixel block are subjected to an encoding process by a method described using FIGS. 2a through 2c below, and image data (16 bytes, i.e., 128 bits) of 1 byte (=8 bits) data per pixel by 16 pixels are encoded as data of a total of 6 bytes (=48 bits) of 2 byte code data by 16 pixels allocated by dividing the data of each pixel, i.e. , 1 byte gradient range exponent LD, 1 bytes mean value information LA, in four levels. Thus, the data quantity is compressed 3/8. FIG. 1c shows the data quantity of the encoded image data equivalent to 6 pixels of image data prior to encoding. Decoding of the encoded data is accomplished by calculating 1 byte image data corresponding to each 2 bits of code data based on the gradient range exponent LD and mean value information LA.
FIGS. 2a through 2c show the GBTC type encoding process and decoding process. FIG. 2a shows the relationship among maximum value Lmax, minimum value Lmin, parameters P1 and P2, and gradient range exponent LD. A predetermined feature quantity required for encoding is determined from image data extracted in block units of 4.times.4 pixels. The feature quantity is determined by the following calculations. First, the maximum value Lmax and minimum value Lmin of each 8-bit image data within a 4.times.4 pixel block are detected. Then, parameter P1 is determined by adding 1/4 of the difference between maximum value Lmax and minimum value Lmin to said minimum value Lmin, then parameter P2 is determined by adding 3/4 of said difference to minimum value Lmin. That is, parameters P1 and P2 are determined via the calculations of Equation 1 and Equation 2 below.
P1=(Lmax+3Lmin)/4 (1) EQU P2=(3Lmax+Lmin)/4 (2)
Then, the mean value Q1 is determined for image data of pixels below parameter P1 among the image data of each pixel. Thereafter, the mean value Q4 is determined for image data of pixels above parameter P2 among the image data of each pixel. The mean value information LA=(Q1+Q4)/2 and gradient range exponent LD=Q4-Q1 are determined.
The standard values L1 and L2 are determined by the calculations of Equations 3 and 4. EQU L1=LA-LD/4 (3) EQU L2=LA+LD/4 (4)
The aforesaid standard values L1 and L2 are used when encoding the 1-byte (8-bits) image data of each pixel, i.e., image data of 256 gradients, to 4 gradient code data.
FIG. 2b shows the value of code data .PHI.ij allocated in accordance with the data value of pixel Xij of line i (where i=1, 2, 3, 4; hereinafter the same) and row j (where j=1, 2, 3, 4; hereinafter the same) within the 4.times.4 pixel block. More specifically, the 2-bit code data .PHI.ij of the values shown in Table 1 below are allocated in accordance with the value of pixel Xij.
TABLE 1 Current range of 1-byte image Allocated 2-bit code data of pixel Xij at line i, row j data .PHI.ij Xij .ltoreq. L1 .PHI.ij = 01 L1 &lt; Xij .ltoreq. LA .PHI.ij = 00 LA &lt; Xij .ltoreq. L2 .PHI.ij = 01 L2 &lt; Xij .PHI.ij = 11
Data encoded by the GBTC method comprise code data (16.times.2 bits) of a 16-pixel block, and the gradient range exponent LD and mean value information LA of each 1 byte (8-bits).
The gradient range exponent LD and mean value information LA are used when decoding the encoded data, as shown in FIG. 2c. That is, the data of pixel Xij are substituted by 256 gradient data of the value shown in Table 2 in accordance with the value code data .PHI.ij allocated to pixel Xij of line i and row j.
TABLE 2 Value of 2-bit code data Method of determining the .PHI. ij allocated to pixel Xij value of substitution 256 of line i, row j gradient data .PHI.ij = 01 Xij = LA - LD/2 = Q1 .PHI.ij = 00 Xij = LA - LD/6 = 2/3Q1 + 1/3Q4 .PHI.ij = 10 Xij = LA + LD/6 = 1/3Q1 + 2/3Q4 .PHI.ij = 11 Xij = LA + LD/2 = Q4
The image data of pixel Xij (where i and j are respectively values among 1, 2, 3, 4) within the 4.times.4 pixel block are substituted by four types of values of 256-gradient data via the GBTC type encoding process and decoding process. The decoded data include obvious errors in comparison to the original document image data. These errors are difficult to discern, however, due to limitations of human visual acuity, i.e., there is virtually no discernible loss of image quality in normal images. Parameters Q1 and Q4 can be determined from the gradient range exponent LD and mean value information LA contained in the coded data. That is, a text image comprising a black color portion below parameter P1 and white color portion above parameter P2 can be reproduced from the coded data.
In the JPEG (Joint Photographic Experts Group) method of Huffman coding of data obtained by DCT (discrete cosine transform) conversion of image data, the data compression rate varies depending on the type of document. That is, although the JPEG method may realize a higher rate of data compression than the GBTC method on a particular document, the JPEG method may not be capable of any compression of another document. Thus, it is difficult to set the capacity of installed memory in image processing apparatuses using the JPEG method. On the other hand, the GBTC method is capable of compressing data at a normally constant compression rate. Therefore, image processing apparatuses using the GBTC method are advantageous in that the capacity of installed memory can be readily set.
Division is widely used in the GBTC type encoding process and decoding process, as shown in Equations 1 through 4 and Table 2 above. Reproducibility is reduced for image data obtained by the decoding process which eliminates differences among constituent data of each pixel during the calculation process when such differences are small. This factor is disadvantageous inasmuch as suitable reproductions cannot be obtained for areas wherein chromaticity and luminance change subtly as in the case of human skin tone.